#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

char* my_strncat(char* s1, const char* s2, size_t num)
{
	char* pf = s1;
	while (*pf)
	{
		pf++;
	}
	while (num --)
	{
		*pf++ = *s2++;
		if (*(s2 - 1) == 0)
			break;
	}
	return s1;
}

int main()
{
	char s1[20] = "abcd";
	char s2[20] = "efgh";
	my_strncat(s1, s2, 3);
	printf("%s\n", s1);
	return 0;
}